其他
2020网鼎杯青龙组_re_signal
看雪论坛作者ID:Craft_A
2020 网鼎杯青龙组_re_signal
public class Main {
public static void main(String[] args) {
char re[] = {34,63,52,50,114,51,24,167,49,241,40,132,193,30,122};
// int opcode[] = { //原始code
// 4,16,8,3,5,1,
// 4,32,8,5,3,1,
// 3,2,8,11,1,
// 12,8,4,4,1,
// 5,3,8,3,33,1,
// 11,8,11,1,
// 4,9,8,3,32,1,
// 2,81,8,4,36,1,
// 12,8,11,1,
// 5,2,8,2,37,1,
// 2,54,8,4,65,1,
// 2,32,8,5,1,1,
// 5,3,8,2,37,1,
// 4,9,8,3,32,1,
// 2,65,8,12,1
// };
int opcode[] = { //调整code顺序
3,5,8,4,16,1,
5,3,8,4,32,1,
11,8,3,2,1,
4,4,8,12,1,
3,33,8,5,3,1,
11,8,11,1,
3,32,8,4,9,1,
4,36,8,2,81,1,
11,8,12,1,
2,37,8,5,2,1,
4,65,8,2,54,1,
5,1,8,2,32,1,
2,37,8,5,3,1,
3,32,8,4,9,1,
12,8,2,65,1
};
char tmp = 0;
int tmp_index = 0;
int opcode_index = 0;
int re_index = 0;
char flag[] = new char[15];
int flag_index = 0;
while(opcode_index < 83){
switch(opcode[opcode_index]){
case 1:
flag[flag_index] = tmp;
++opcode_index;
++flag_index;
++re_index;
break;
case 2:
tmp = (char) (re[re_index] - (char)(opcode[opcode_index + 1]& 0xff));
opcode_index += 2;
break;
case 3:
tmp = (char) (re[re_index] + (opcode[opcode_index + 1]& 0xff ));
opcode_index += 2;
break;
case 4:
tmp = (char) ((opcode[opcode_index + 1] & 0xff) ^ re[re_index]);
opcode_index += 2;
break;
case 5:
tmp = (char) (re[re_index] / (opcode[opcode_index + 1] & 0xff));
opcode_index += 2;
break;
case 6:
++opcode_index;
break;
case 8:
re[tmp_index] = tmp;
++opcode_index;
++tmp_index;
break;
case 11:
tmp = (char) (re[re_index] + 1);
++opcode_index;
break;
case 12:
tmp = (char) (re[re_index] - 1);
++opcode_index;
break;
default:
continue;
}
}
System.out.println(new String(flag)); //757515121f3d478
}
}
看雪ID:Craft_A
https://bbs.pediy.com/user-834792.htm
推荐文章++++